$(function(){
		/*初始化表格*/
		$('#sysOrg').datagrid({
    		url:'backsysorgcheckjson',
    		collapsible:true,
    		fit:true,
			fitColumns:true,
			toolbar:'#footer',
			pagination:true,
			pageSize:20,
			pageList:[20,50,100,200],
			remoteSort:false,
   			columns:[[
   			 	{field:'ck',checkbox:true},
   			 	{field:'orgID',hidden:'true'},
				{field:'orgName',title:'公司名称',align:'center',width:'15%'},
				{field:'contact',title:'公司联系人',align:'center',width:'15%'},
				{field:'mobile',title:'联系手机号',align:'center',width:'15%'},
				{field:'tel',title:'联系电话',align:'center',width:'15%'},
				{field:'upOrgName',title:'上级所属公司',align:'center',width:'15%'},
				{field:'memo',title:'备注',align:'center',width:'23%'}
    		]]
		});
			
});


function checkOrg(){
	var rows = $('#sysOrg').datagrid('getSelections');
	var checkNum = rows.length;
	if(checkNum==0){
		$.messager.alert('错误','至少选择一项','error');
	} else if(checkNum>1){
		$.messager.alert('错误','最多选择一项','error');
	}else{
		var iOrgID = rows[0].orgID;
		location.href="/mmy/orginfocheck?OrgID="+iOrgID;		
	}		
};

function pass(){
	var id = $("#orgid").val();
	var url = "/mmy/orgcheck?id=";
	url = url + id +"&flag=" + 1;
	location.href = url;
}

function no(){
	var id = $("#orgid").val();
	var url = "/mmy/orgcheck?id=";
	url = url + id +"&flag=" + 0;
	location.href = url;
}

